<template>
  <div>
    <!-- 三级联动组件已经注册为全局组件，不需要再导入引用，可以直接使用 -->
    <TypeNav></TypeNav>
    <ListContainer></ListContainer>
    <Recomment></Recomment>
    <Rank></Rank>
    <Link></Link>
    <Floor v-for="item in floorList" :key="item.id" :list="item"></Floor>
    <Brand></Brand>
  </div>
</template>

<script>
import TypeNav from "./TypeNav";
import ListContainer from "./ListContainer/index.vue";
import Recomment from "./Recomment/index.vue";
import Rank from "./Rank/index.vue";
import Link from "./Link/index.vue";
import Floor from "./Floor/index.vue";
import Brand from "./Brand/index.vue";
import{mapState} from 'vuex'
export default {
  components: {
    TypeNav,
    ListContainer,
    Recomment,
    Rank,
    Link,
    Floor,
    Brand,
  },
  mounted(){
      //派发action，获取floor组件的数据
      this.$store.dispatch('GetFloorList')
      //获取用户信息在首页展示
      this.$store.dispatch('getUserInfo')
    },
  computed:{
        ...mapState({
            floorList:(state)=>state.home.floorList})
    }
  
};
</script>

<style>
</style>